<?php
$app->group('/test',function() use($app){
    $app->get('/hello',function() use($app){
        $user=new \Hengha\Model\User();
        $models=$app->db->fetchAll('select * from jokes order by id desc limit 10');
        $app->response->headers->set('Content-Type','application/json');
        echo json_encode($models);
    })->name('test-hello');
    $app->get('/hello/page/:page',function($page) use($app){
        
    })->name('test-hello-page');
    $app->map('/foo', function() {
        echo "Fancy, huh?";
    })->via('GET', 'POST')->name('foo');
});